package sistemasdistribuidos;

import classesBase.Animal;
import classesBase.ModelaTabela;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.ListSelectionModel;
import telasMensagem.Bloqueio;
import telasMensagem.SimNao;

public class AnimaisCadastrados extends javax.swing.JDialog {

    int flag = 1;
    int flag2 = 1;
    ModelaTabela modela = new ModelaTabela();
    SimpleDateFormat formata = new SimpleDateFormat("yyyy-MM-dd");
    static boolean conf = false;

    public AnimaisCadastrados(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        iniciar();
    }

    public AnimaisCadastrados(java.awt.Frame parent, boolean modal, int sele) {
        super(parent, modal);
        initComponents();
        flag = sele;
        jButtonDeletarCadastro.setText("Selecionar Animal");
        iniciar();
    }

    public void iniciar() {
        tabela();
        desabilitar(false, true);
        jTextFieldCodigoAnimal.setEditable(false);
        jTextFieldCodigoDono.setEditable(false);
        jTextFieldDono.setEditable(false);
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                if (flag2 == 0) {
                    blo("<html>As informações não foram salvas! <br>"
                            + "Por favor, salve "
                            + "os dados editados antes de deixar esta tela!<html>");
                } else {
                    dispose();
                }
            }
        });
    }

     public void racas(String animal) {
        jComboBoxRaca.removeAllItems();
        byte i = 0;
        jComboBoxRaca.addItem("Selecione");
        jComboBoxRaca.addItem(animal);
    }
    public void tabela() {
        modela = new ModelaTabela();
        modela.setColumnIdentifiers(new String[]{"Código", "Nome", "ID Dono", "Dono", "Telefone"});
        modela.addRow(new String[]{"123", "totó", "777", "Faranush", "(19)3224-4000"});
        modela.addRow(new String[]{"456", "Tonto", "222", "Fulano", "(19)4002-8922"});
        /*Preencher com dados do banco*/
        jTableAnimalCadastrados.setModel(modela);
        jTableAnimalCadastrados.setRowHeight(20);
        jTableAnimalCadastrados.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    }

    public static void confirma(boolean co) {
        conf = co;
    }

    public void blo(String msn) {
        Bloqueio b = new Bloqueio(null, true, msn);
        b.setLocationRelativeTo(null);
        b.setVisible(true);
    }

    public static void informacoes(String idDono, String nomeDono) {
        jTextFieldDono.setText(nomeDono);
        jTextFieldCodigoDono.setText(idDono);
    }

    public void desabilitar(boolean habilitar, boolean contrario) {
        jTextFieldNome.setEditable(habilitar);
        jButtonDono.setEnabled(habilitar);
        jComboBoxEspecie1.setEnabled(habilitar);
        jComboBoxRaca.setEnabled(habilitar);
        jTextFieldPeso.setEditable(habilitar);
        jDateChooserNascimento.setEnabled(habilitar);
        jRadioButtonFeminino.setEnabled(habilitar);
        jRadioButtonMasculino.setEnabled(habilitar);
        jTextFieldRegistro.setEditable(habilitar);
        jTextPaneObservacoes.setEditable(habilitar);

        jTabbedPane2.setEnabledAt(0, contrario);
        jButtonDeletarCadastro.setEnabled(contrario);
        jButtonNovoCadastro.setEnabled(contrario);
        jTableAnimalCadastrados.setEnabled(contrario);
        jTextFieldPesquisa.setEditable(contrario);
        jButtonBuscar.setEnabled(contrario);
        jComboBoxPesquisa.setEnabled(contrario);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTableAnimalCadastrados = new javax.swing.JTable();
        jTextFieldPesquisa = new javax.swing.JTextField();
        jLabelMsg10 = new javax.swing.JLabel();
        jComboBoxPesquisa = new javax.swing.JComboBox();
        jButtonBuscar = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jLabelMsg13 = new javax.swing.JLabel();
        jTextFieldCodigoAnimal = new javax.swing.JTextField();
        jTextFieldNome = new javax.swing.JTextField();
        jLabelMsg3 = new javax.swing.JLabel();
        jLabelMsg12 = new javax.swing.JLabel();
        jTextFieldDono = new javax.swing.JTextField();
        jLabelMsg11 = new javax.swing.JLabel();
        jLabelMsg15 = new javax.swing.JLabel();
        jTextFieldPeso = new javax.swing.JTextField();
        jComboBoxEspecie1 = new javax.swing.JComboBox();
        jLabelMsg16 = new javax.swing.JLabel();
        jComboBoxRaca = new javax.swing.JComboBox();
        jLabelMsg9 = new javax.swing.JLabel();
        jTextFieldRegistro = new javax.swing.JTextField();
        jLabelMsg18 = new javax.swing.JLabel();
        jRadioButtonMasculino = new javax.swing.JRadioButton();
        jRadioButtonFeminino = new javax.swing.JRadioButton();
        jLabelMsg17 = new javax.swing.JLabel();
        jLabelMsg19 = new javax.swing.JLabel();
        jScrollPane6 = new javax.swing.JScrollPane();
        jTextPaneObservacoes = new javax.swing.JTextPane();
        jButtonDono = new javax.swing.JButton();
        jLabelMsg14 = new javax.swing.JLabel();
        jTextFieldCodigoDono = new javax.swing.JTextField();
        jDateChooserNascimento = new com.toedter.calendar.JDateChooser();
        jLabelMsg21 = new javax.swing.JLabel();
        jButtonDeletarCadastro = new javax.swing.JButton();
        jButtonEditarCadastro = new javax.swing.JButton();
        jButtonNovoCadastro = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Animais Cadastrados");
        setModal(true);
        setName("AnimaisCadastrados"); // NOI18N

        jPanel1.setBackground(new java.awt.Color(255, 102, 0));
        jPanel1.setBorder(javax.swing.BorderFactory.createMatteBorder(3, 3, 3, 3, new java.awt.Color(0, 0, 0)));

        jTabbedPane2.setBackground(new java.awt.Color(255, 102, 0));
        jTabbedPane2.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N

        jPanel4.setBackground(new java.awt.Color(255, 102, 0));
        jPanel4.setBorder(javax.swing.BorderFactory.createMatteBorder(3, 3, 3, 3, new java.awt.Color(0, 0, 0)));

        jTableAnimalCadastrados.setBorder(javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, new java.awt.Color(0, 0, 0)));
        jTableAnimalCadastrados.setFont(new java.awt.Font("Segoe UI", 0, 18)); // NOI18N
        jTableAnimalCadastrados.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Nome", "Id Dono", "Dono", "Telefone"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableAnimalCadastrados.setToolTipText("Clique no animal desejado para ver os detalhes");
        jTableAnimalCadastrados.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jTableAnimalCadastrados.setRowHeight(20);
        jTableAnimalCadastrados.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableAnimalCadastradosMouseClicked(evt);
            }
        });
        jScrollPane5.setViewportView(jTableAnimalCadastrados);

        jTextFieldPesquisa.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jTextFieldPesquisa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldPesquisaActionPerformed(evt);
            }
        });

        jLabelMsg10.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg10.setText("Pesquisar:");

        jComboBoxPesquisa.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jComboBoxPesquisa.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Nome", "Código", "Dono", "Telefone", "Raça" }));
        jComboBoxPesquisa.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jComboBoxPesquisa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxPesquisaActionPerformed(evt);
            }
        });

        jButtonBuscar.setBackground(new java.awt.Color(255, 255, 255));
        jButtonBuscar.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jButtonBuscar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Busca_Icon.png"))); // NOI18N
        jButtonBuscar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jButtonBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonBuscarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabelMsg10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, 326, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jComboBoxPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 598, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(12, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabelMsg10)
                        .addComponent(jTextFieldPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jComboBoxPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jButtonBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(45, 45, 45))
        );

        jTabbedPane2.addTab("Animais Cadastrados", jPanel4);

        jPanel3.setBackground(new java.awt.Color(255, 102, 0));
        jPanel3.setBorder(javax.swing.BorderFactory.createMatteBorder(3, 3, 3, 3, new java.awt.Color(0, 0, 0)));

        jLabelMsg13.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg13.setText("Código do Animal:");
        jLabelMsg13.setToolTipText("Código gerado automaticamente pelo sistema");

        jTextFieldCodigoAnimal.setEditable(false);
        jTextFieldCodigoAnimal.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N

        jTextFieldNome.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jTextFieldNome.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldNomeActionPerformed(evt);
            }
        });

        jLabelMsg3.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg3.setText("Nome:");

        jLabelMsg12.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg12.setText("<html><u>Dono:<u></html>");
        jLabelMsg12.setToolTipText("Abrir Cadastro");
        jLabelMsg12.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jLabelMsg12.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabelMsg12MouseClicked(evt);
            }
        });

        jTextFieldDono.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jTextFieldDono.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldDonoActionPerformed(evt);
            }
        });

        jLabelMsg11.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg11.setText("Espécie:");

        jLabelMsg15.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg15.setText("Peso:");

        jTextFieldPeso.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N

        jComboBoxEspecie1.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jComboBoxEspecie1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecione", "Cão", "Gato", "Pássaro", "Roedor" }));
        jComboBoxEspecie1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jComboBoxEspecie1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxEspecie1ActionPerformed(evt);
            }
        });

        jLabelMsg16.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg16.setText("Raça:");

        jComboBoxRaca.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jComboBoxRaca.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecione" }));
        jComboBoxRaca.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jComboBoxRaca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxRacaActionPerformed(evt);
            }
        });

        jLabelMsg9.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg9.setText("Data de Nascimento:");

        jTextFieldRegistro.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N

        jLabelMsg18.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg18.setText("Registro:");

        jRadioButtonMasculino.setBackground(new java.awt.Color(255, 102, 0));
        buttonGroup1.add(jRadioButtonMasculino);
        jRadioButtonMasculino.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jRadioButtonMasculino.setText("Macho");

        jRadioButtonFeminino.setBackground(new java.awt.Color(255, 102, 0));
        buttonGroup1.add(jRadioButtonFeminino);
        jRadioButtonFeminino.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jRadioButtonFeminino.setSelected(true);
        jRadioButtonFeminino.setText("Fêmea");

        jLabelMsg17.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg17.setText("Sexo:");

        jLabelMsg19.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg19.setText("Observações:");

        jTextPaneObservacoes.setEditable(false);
        jTextPaneObservacoes.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jScrollPane6.setViewportView(jTextPaneObservacoes);

        jButtonDono.setBackground(new java.awt.Color(255, 255, 255));
        jButtonDono.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jButtonDono.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Busca_Icon.png"))); // NOI18N
        jButtonDono.setToolTipText("Buscar o cadastro do responsável pelo animal");
        jButtonDono.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jButtonDono.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonDonoActionPerformed(evt);
            }
        });

        jLabelMsg14.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
        jLabelMsg14.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/3545.png"))); // NOI18N

        jTextFieldCodigoDono.setEditable(false);
        jTextFieldCodigoDono.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N

        jDateChooserNascimento.setBackground(new java.awt.Color(255, 102, 0));
        jDateChooserNascimento.setFont(new java.awt.Font("Segoe UI", 0, 12)); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jLabelMsg14)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addComponent(jTextFieldCodigoDono, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButtonDono, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                                .addGap(37, 37, 37)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabelMsg15)
                                        .addGap(18, 18, 18)
                                        .addComponent(jTextFieldPeso, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jLabelMsg9)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jDateChooserNascimento, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jTextFieldRegistro, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabelMsg17)
                                        .addGap(18, 18, 18)
                                        .addComponent(jRadioButtonFeminino)
                                        .addGap(18, 18, 18)
                                        .addComponent(jRadioButtonMasculino)
                                        .addGap(37, 37, 37)
                                        .addComponent(jLabelMsg18)
                                        .addGap(118, 118, 118))
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabelMsg11)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jComboBoxEspecie1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jLabelMsg16)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jComboBoxRaca, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(0, 1, Short.MAX_VALUE)))
                        .addContainerGap(21, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabelMsg19)
                        .addGap(17, 17, 17)
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 460, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabelMsg13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextFieldCodigoAnimal, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelMsg3)
                            .addComponent(jLabelMsg12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(22, 22, 22)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jTextFieldNome)
                                .addGap(19, 19, 19))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jTextFieldDono, javax.swing.GroupLayout.PREFERRED_SIZE, 394, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(7, 7, 7)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelMsg13)
                    .addComponent(jTextFieldCodigoAnimal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelMsg3)
                    .addComponent(jTextFieldNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(8, 8, 8)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabelMsg12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jTextFieldDono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jTextFieldCodigoDono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jButtonDono, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelMsg11)
                            .addComponent(jComboBoxEspecie1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelMsg16)
                            .addComponent(jComboBoxRaca, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(15, 15, 15)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextFieldPeso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelMsg9, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelMsg15)
                            .addComponent(jDateChooserNascimento, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelMsg17)
                            .addComponent(jRadioButtonFeminino)
                            .addComponent(jRadioButtonMasculino)
                            .addComponent(jLabelMsg18, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldRegistro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addComponent(jLabelMsg14)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelMsg19, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Detalhes", jPanel3);

        jLabelMsg21.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N
        jLabelMsg21.setText("Animais Cadastrados");

        jButtonDeletarCadastro.setBackground(new java.awt.Color(255, 255, 255));
        jButtonDeletarCadastro.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jButtonDeletarCadastro.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/limpar.png"))); // NOI18N
        jButtonDeletarCadastro.setText("Deletar Cadastro");
        jButtonDeletarCadastro.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jButtonDeletarCadastro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonDeletarCadastroActionPerformed(evt);
            }
        });

        jButtonEditarCadastro.setBackground(new java.awt.Color(255, 255, 255));
        jButtonEditarCadastro.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jButtonEditarCadastro.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/pata.png"))); // NOI18N
        jButtonEditarCadastro.setText("Editar Cadastro");
        jButtonEditarCadastro.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jButtonEditarCadastro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonEditarCadastroActionPerformed(evt);
            }
        });

        jButtonNovoCadastro.setBackground(new java.awt.Color(255, 255, 255));
        jButtonNovoCadastro.setFont(new java.awt.Font("Segoe UI", 0, 16)); // NOI18N
        jButtonNovoCadastro.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/pata.png"))); // NOI18N
        jButtonNovoCadastro.setText("Novo Cadastro");
        jButtonNovoCadastro.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jButtonNovoCadastro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonNovoCadastroActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jLabelMsg21)
                        .addGap(154, 154, 154))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jButtonNovoCadastro, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButtonEditarCadastro, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(27, 27, 27)
                        .addComponent(jButtonDeletarCadastro, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 631, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButtonDeletarCadastro, jButtonEditarCadastro, jButtonNovoCadastro});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jLabelMsg21)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButtonDeletarCadastro, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButtonNovoCadastro, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButtonEditarCadastro, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButtonEditarCadastro, jButtonNovoCadastro});

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        getAccessibleContext().setAccessibleName("");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jTextFieldPesquisaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldPesquisaActionPerformed

    }//GEN-LAST:event_jTextFieldPesquisaActionPerformed

    private void jComboBoxPesquisaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxPesquisaActionPerformed

    }//GEN-LAST:event_jComboBoxPesquisaActionPerformed

    private void jButtonBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonBuscarActionPerformed
        if (jTextFieldPesquisa.getText().length() > 0) {
            /*
             Buscar no banco o resultado da pesquisa digitada
             */
        }
    }//GEN-LAST:event_jButtonBuscarActionPerformed

    private void jButtonDeletarCadastroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDeletarCadastroActionPerformed
        //função da tela banho e tosa
        if (flag > 1) {
            if (jTableAnimalCadastrados.getSelectedRow() > -1) {
                if (flag == 2) {
                    AgendaBanhoTosa.informacoes((String) jTableAnimalCadastrados.getValueAt(jTableAnimalCadastrados.getSelectedRow(), 1),
                            (String) jTableAnimalCadastrados.getValueAt(jTableAnimalCadastrados.getSelectedRow(), 3),
                            (String) jTableAnimalCadastrados.getValueAt(jTableAnimalCadastrados.getSelectedRow(), 0),
                            (String) jTableAnimalCadastrados.getValueAt(jTableAnimalCadastrados.getSelectedRow(), 2));
                }
                if (flag == 3) {
                    IncluirAgendamento.selecionarAnimal(
                            (String) jTableAnimalCadastrados.getValueAt(jTableAnimalCadastrados.getSelectedRow(), 0),
                            (String) jTableAnimalCadastrados.getValueAt(jTableAnimalCadastrados.getSelectedRow(), 1),
                            (String) jTableAnimalCadastrados.getValueAt(jTableAnimalCadastrados.getSelectedRow(), 3),
                            Integer.parseInt((String) jTableAnimalCadastrados.getValueAt(jTableAnimalCadastrados.getSelectedRow(), 2)));
                }
                this.dispose();
            } else {
                blo("<html>Nenhum cadastro selecionado! <br> "
                        + "Por favor, selecione o cadastro "
                        + "do animal que deseja selecionar!</html>");
            }
            // função do deletar
        } else {
            if (jTableAnimalCadastrados.getSelectedRow() > -1) {
                SimNao sn = new SimNao(null, true, "<html>Tem certeza que"
                        + "deseja apagar permanentemente o cadastro "
                        + "selecionado?</html>", 5);
                sn.setLocationRelativeTo(null);
                sn.setVisible(true);
                if (conf == true) {
                    jTextFieldCodigoAnimal.setText(null);
                    jTextFieldNome.setText(null);
                    jTextFieldDono.setText(null);
                    jTextFieldCodigoDono.setText(null);
                    jComboBoxEspecie1.setSelectedIndex(0);
                    jComboBoxRaca.setSelectedIndex(0);
                    jTextFieldPeso.setText(null);
                    jDateChooserNascimento.setDate(null);
                    jTextFieldRegistro.setText(null);
                    jTextPaneObservacoes.setText(null);
                    /*deletar cadastro do banco*/
                    modela.removeRow(jTableAnimalCadastrados.getSelectedRow());
                }
            } else {
                blo("<html>Nenhum cadastro foi selecionado! <br> Por favor, selecione o cadastro "
                        + "deseja deletar!</html>");
            }
        }
    }//GEN-LAST:event_jButtonDeletarCadastroActionPerformed

    private void jButtonEditarCadastroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEditarCadastroActionPerformed
        if (flag2 == 1) {
            int linha = jTableAnimalCadastrados.getSelectedRow();
            if (linha > -1) {
                jButtonEditarCadastro.setText("Salvar Cadastro");
                desabilitar(true, false);

                flag2 = 0;
            } else {
                blo("<html>Nenhum cadastro selecionado! <br>"
                        + "Por favor, selecione na tabela o cadastro que "
                        + "deseja modificar!</html>");
            }
        } else {
            Animal animal = new Animal();
            animal.setIdAnimal(Integer.parseInt(jTextFieldCodigoAnimal.getText()));
            animal.setNome(jTextFieldNome.getText());
            animal.setEspecie((String) jComboBoxEspecie1.getSelectedItem());
            animal.setRaca((String) jComboBoxRaca.getSelectedItem());
            animal.setPeso(jTextFieldPeso.getText());
            try {
                animal.setNascimento(formata.format(jDateChooserNascimento.getDate()));
            } catch (Exception ex) {
                animal.setNascimento(null);
            }
            if (jRadioButtonFeminino.isSelected() == true) {
                animal.setSexo("Femea");
            } else {
                animal.setSexo("Macho");
            }
            animal.setRegistro(jTextFieldRegistro.getText());
            animal.setObs(jTextPaneObservacoes.getText());

            if (animal.getNome().length() == 0) {
                blo("<html>Nenhum nome foi inserido! <br>"
                        + "Por favor, informe o nome do animal antes"
                        + " de prosseguir!</html>");
            } else {
                if (animal.getEspecie().equals("Selecione")) {
                    blo("<html>Nenhuma espécie foi selecionada! <br>"
                            + "Por favor, selecione a espécie do animal antes"
                            + " de prosseguir!</html>");
                } else {
                    if (animal.getRaca().equals("Selecione")) {
                        blo("<html>Nenhuma raça foi selecionada! <br>"
                                + "Por favor, selecione a raça do animal antes"
                                + " de prosseguir!</html>");
                    } else {

                        try {
                            animal.setIdDono(Integer.parseInt(jTextFieldCodigoDono.getText()));
                            jButtonEditarCadastro.setText("Editar Cadastro");

                            modela.setValueAt(jTextFieldNome.getText(), jTableAnimalCadastrados.getSelectedRow(), 1);
                            modela.setValueAt(jTextFieldCodigoDono.getText(), jTableAnimalCadastrados.getSelectedRow(), 2);
                            modela.setValueAt(jTextFieldDono.getText(), jTableAnimalCadastrados.getSelectedRow(), 3);
                     
                            desabilitar(false, true);

                            flag2 = 1;
                            /*
                             Update no Banco de Dados
                             */

                        } catch (Exception ex) {
                            blo("<html>Nenhum cliente foi selecionado! <br>"
                                    + "Por favor, selecione o cliente responsável pelo "
                                    + "mesmo antes de prosseguir!</html>");
                        }
                    }
                }
            }
        }

    }//GEN-LAST:event_jButtonEditarCadastroActionPerformed

    private void jTextFieldDonoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldDonoActionPerformed

    }//GEN-LAST:event_jTextFieldDonoActionPerformed

    private void jComboBoxEspecie1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxEspecie1ActionPerformed
        if (jComboBoxEspecie1.getSelectedItem().equals("Cão")) {
                racas("Cão");
            }
            if (jComboBoxEspecie1.getSelectedItem().equals("Gato")) {
                racas("Gato");
            }
            if (jComboBoxEspecie1.getSelectedItem().equals("Pássaro")) {
                racas("Pássaro");
            }
            if (jComboBoxEspecie1.getSelectedItem().equals("Roedor")) {
                racas("Roedor");
            }
    }//GEN-LAST:event_jComboBoxEspecie1ActionPerformed

    private void jComboBoxRacaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxRacaActionPerformed

    }//GEN-LAST:event_jComboBoxRacaActionPerformed

    private void jButtonDonoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDonoActionPerformed
        ClientesCadastrados cc = new ClientesCadastrados(null, true, 2);
        cc.setLocationRelativeTo(null);
        cc.setVisible(true);
    }//GEN-LAST:event_jButtonDonoActionPerformed

    private void jTextFieldNomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldNomeActionPerformed

    }//GEN-LAST:event_jTextFieldNomeActionPerformed

    private void jButtonNovoCadastroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNovoCadastroActionPerformed
        CadastroAnimal ca = new CadastroAnimal(null, true);
        ca.setLocationRelativeTo(null);
        ca.setVisible(true);
        if (ca.isVisible() == false) {
            //Atualizar 
            tabela();
        }
    }//GEN-LAST:event_jButtonNovoCadastroActionPerformed

    private void jTableAnimalCadastradosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableAnimalCadastradosMouseClicked
        int linha = jTableAnimalCadastrados.getSelectedRow();
        Date nas = new Date("10/01/2014");
        /*
         SUBSTITUIR
         preencher dados do banco nos campos*/
        jTextFieldCodigoAnimal.setText((String) jTableAnimalCadastrados.getValueAt(linha, 0));
        jTextFieldNome.setText((String) jTableAnimalCadastrados.getValueAt(linha, 1));
        jTextFieldDono.setText((String) jTableAnimalCadastrados.getValueAt(linha, 3));
        jTextFieldCodigoDono.setText((String) jTableAnimalCadastrados.getValueAt(linha, 2));
        try {
            jComboBoxEspecie1.setSelectedIndex(1);
            jComboBoxRaca.setSelectedIndex(2);
            jDateChooserNascimento.setDate(nas);
        } catch (Exception ex) {
            System.out.println(ex);
        }
        jTextPaneObservacoes.setText("Setando as observações para teste");
        jTextFieldPeso.setText("150");

    }//GEN-LAST:event_jTableAnimalCadastradosMouseClicked

    private void jLabelMsg12MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabelMsg12MouseClicked
        if (jTextFieldDono.getText().length() > 0) {
            /*Buscar dono no banco e abrir ficha*/
        }
    }//GEN-LAST:event_jLabelMsg12MouseClicked
    public static void main(String args[]) {
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(AnimaisCadastrados.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(AnimaisCadastrados.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(AnimaisCadastrados.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(AnimaisCadastrados.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                AnimaisCadastrados dialog = new AnimaisCadastrados(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton jButtonBuscar;
    private javax.swing.JButton jButtonDeletarCadastro;
    private javax.swing.JButton jButtonDono;
    private javax.swing.JButton jButtonEditarCadastro;
    private javax.swing.JButton jButtonNovoCadastro;
    public static javax.swing.JComboBox jComboBoxEspecie1;
    public static javax.swing.JComboBox jComboBoxPesquisa;
    public static javax.swing.JComboBox jComboBoxRaca;
    private com.toedter.calendar.JDateChooser jDateChooserNascimento;
    private javax.swing.JLabel jLabelMsg10;
    private javax.swing.JLabel jLabelMsg11;
    private javax.swing.JLabel jLabelMsg12;
    private javax.swing.JLabel jLabelMsg13;
    private javax.swing.JLabel jLabelMsg14;
    private javax.swing.JLabel jLabelMsg15;
    private javax.swing.JLabel jLabelMsg16;
    private javax.swing.JLabel jLabelMsg17;
    private javax.swing.JLabel jLabelMsg18;
    private javax.swing.JLabel jLabelMsg19;
    private javax.swing.JLabel jLabelMsg21;
    private javax.swing.JLabel jLabelMsg3;
    private javax.swing.JLabel jLabelMsg9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JRadioButton jRadioButtonFeminino;
    private javax.swing.JRadioButton jRadioButtonMasculino;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTable jTableAnimalCadastrados;
    public static javax.swing.JTextField jTextFieldCodigoAnimal;
    public static javax.swing.JTextField jTextFieldCodigoDono;
    public static javax.swing.JTextField jTextFieldDono;
    public static javax.swing.JTextField jTextFieldNome;
    public static javax.swing.JTextField jTextFieldPeso;
    public static javax.swing.JTextField jTextFieldPesquisa;
    public static javax.swing.JTextField jTextFieldRegistro;
    public static javax.swing.JTextPane jTextPaneObservacoes;
    // End of variables declaration//GEN-END:variables
}
